#include "drv_a4950.h"

void a4950_load(int32_t left, int32_t right)
{
    UL_LIMIT(left, 500);
    UL_LIMIT(right, 500);
    pwm_set_ccr(A4950_INST, GPIO_A4950_C0_IDX, 500 - left);
    pwm_set_ccr(A4950_INST, GPIO_A4950_C1_IDX, 500 + left);
    pwm_set_ccr(A4950_INST, GPIO_A4950_C2_IDX, 500 + right);
    pwm_set_ccr(A4950_INST, GPIO_A4950_C3_IDX, 500 - right);
}


